home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_sharkgatehall.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  146 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_SharkGateHall.cog
  4. #
  5. # This cog causes 3 spiders to attack upon an entered message. One skitters down a web
  6. #
  7. # [CM]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. message    startup
  15. message    entered
  16.  
  17.  
  18. #............ACTORS..........
  19. thing    player                                    local
  20.  
  21. thing    spider0    
  22. thing    spider1    
  23. thing    spider2                                    local    
  24. thing    spider3                                    local    
  25.  
  26.  
  27. #............TRIGGERS..........
  28. sector    attack_sect
  29. surface    draw_surf
  30.  
  31.  
  32. #............AI MOVE TARGETS..........
  33. thing    spider0_mv0    
  34. thing    spider1_mv0    
  35.  
  36.     
  37.  
  38.  
  39. #............AI EVENT SPOTS..........
  40. thing    spider2pos
  41. thing    spider3pos
  42.  
  43.  
  44. #............VARIABLES..........
  45. int        music                                    local
  46. int        spider2                                    local
  47. int        drawn=0                                    local
  48. int        attacked=0                                local
  49.  
  50.  
  51. #............TEMPLATES..........
  52. template    tpl_Spider=spider_wall                local
  53.  
  54.  
  55. #............SOUNDS..........
  56. sound    attack_cue=mus_gen_eerie1.wav                local
  57.  
  58.  
  59. end
  60.  
  61. # ========================================================================================
  62.  
  63. code
  64.  
  65. startup:
  66.  
  67.     GetThingClassCog(spider2);
  68.     
  69.     # Pointer to Player...
  70.     player = GetLocalPlayerThing();
  71.  
  72.     # disable spiders
  73.     AISetCutSceneMode(spider0);
  74.     AISetCutSceneMode(spider1);
  75.     SetThingFlags(spider0, 0x80000);
  76.     SetThingFlags(spider1, 0x80000);
  77.  
  78. return;
  79.  
  80. # ========================================================================================
  81. entered:
  82.  
  83. If ((GetSenderRef() == draw_surf) && (drawn == 0))
  84.     {
  85.     #print("spiders have been drawn");
  86.     drawn = 1;
  87.     ClearThingFlags(spider0, 0x80000);
  88.     ClearThingFlags(spider1, 0x80000);
  89.     }
  90.  
  91.  
  92. If ((GetSenderRef() == attack_sect) && (attacked == 0))
  93.     {
  94.     #print("spiders are attacking");
  95.     attacked = 1;
  96.     Sleep(0.5);
  97.     # danger cue
  98.     PlaySoundLocal(attack_cue, 1.0, 0.0, 0x0, 0);
  99.     
  100.     # spiders look at player
  101.     AISetLookThing(spider0, player);
  102.     AISetLookThing(spider1, player);
  103.  
  104.     # spiders move toward player
  105.     AISetMoveSpeed(spider0, 1.0);
  106.     AISetMoveThing(spider0, spider0_mv0, 0);
  107.  
  108.     AISetMoveSpeed(spider1, 1.0);
  109.     AISetMoveThing(spider1, spider1_mv0, 0);
  110.  
  111.     Sleep(2.0);
  112.  
  113.     # spiders resume AI and attack
  114.     AIClearCutSceneMode(spider0);
  115.     AIClearCutSceneMode(spider1);
  116.  
  117.     Sleep(1.0);
  118.     
  119.     # create the ceiling drop spider
  120.     spider2 = CreateThing(tpl_Spider, spider2pos);
  121.     
  122.     #sends message to spider_wall's class cog, saying "user0" (27)
  123.     SendMessageEx(GetThingClassCog(spider2), user0, spider2, 0, 0, 0);
  124.     
  125.  
  126.     Sleep(2.0);
  127.     
  128.     # create the ceiling drop spider
  129.     spider3 = CreateThing(tpl_Spider, spider3pos);
  130.     
  131.     #sends message to spider_wall's class cog, saying "user0" (27)
  132.     SendMessageEx(GetThingClassCog(spider3), user0, spider3, 0, 0, 0);
  133.     }
  134.  
  135.  
  136. return;
  137.  
  138.  
  139.  
  140. # ========================================================================================
  141. end
  142.  
  143.  
  144.  
  145.  
  146.